import {memberList} from '../../../request/api'

interface StateMember {
    memberlist:Array<object>
}

const state = {
    memberlist: []
}

const getters = {
    getMemberList(state:StateMember) {
        return state.memberlist
    }
}

const mutations = {
    REQ_MEMBERLIST(state:StateMember,payload:any){
        state.memberlist = payload
    }
}

const actions = {
    getMemberListAction(context:any){
        memberList().then(res=>{
            if (res.code == 200) {
                console.log(res,'会员列表222');
                context.commit('REQ_MEMBERLIST',res.list)
            }
        })
    }
}

export default {
    state,
    getters,
    mutations,
    actions,
    namespaced: true
}